package com.lesson00;

import java.awt.*;

public class TestGridLayout {

    public static void main(String[] args) {
        Frame frame = new Frame("TestGridLayout");
        Button east = new Button("East");
        Button west = new Button("West");
        Button south = new Button("South");
        Button north = new Button("North");
        Button center = new Button("Center");

        frame.setLayout(new GridLayout(3, 3)); // 3行3列，组件之间的水平和垂直间距都是5
        frame.add(east);
        frame.add(west);
        frame.add(south);
        frame.add(north);
        frame.add(center);
        frame.setSize(400, 400);
        frame.pack();
        frame.setVisible(true);

    }
}
